﻿@using SmartStore.Rules
@model IRuleExpression
@{
    var metadata = Model.Descriptor.Metadata;
    var id = string.Concat("rule-value-", Model.Id);
    var min = metadata.Get("min") as int?;
    var max = metadata.Get("max") as int?;
    var step = metadata.Get("step") as int?;
}
<div class="numerictextbox-group flex-grow-1">
	@(Html.Telerik().IntegerTextBox()
        .Name(id)
        .EmptyMessage(T("Common.EnterValue"))
        .ButtonTitleUp(T("Common.IncreaseValue"))
        .ButtonTitleDown(T("Common.DecreaseValue"))
        .MinValue(min)
        .MaxValue(max)
        .IncrementStep(step ?? 1)
        .ClientEvents(x => x.OnChange("onRuleValueChanged"))
        .Value(Model.Value as int?)
	)
</div>